package com.qumap.item.content;

import java.io.Serializable;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: 12.04.11
 * Time: 18:08
 * To change this template use File | Settings | File Templates.
 */
public class ObjectOnMapShort implements Serializable {

    public static final byte UNSET = -1;


	public ObjectOnMapShort() {
	}

	public ObjectOnMapShort(Integer id, Double longtitude, Double lattitude) {
		this.id = id;
		this.longtitude = longtitude;
		this.lattitude = lattitude;
	}

	private int id = UNSET;

	private double longtitude;

	private double lattitude;


	protected byte type = UNSET;


	public int getId() {
		return id;
	}

    public void setId(int id) {
        this.id = id;
    }

	public double getLongtitude() {
		return longtitude;
	}

	public void setLongtitude(double longtitude) {
		this.longtitude = longtitude;
	}

	public double getLattitude() {
		return lattitude;
	}

	public void setLattitude(double lattitude) {
		this.lattitude = lattitude;
	}

    public void setType(byte type) {
        this.type = type;
    }

	public byte getType() {
		return type;
	}

    public void putTo(ObjectOnMapShort content) {
        content.setId(getId());
        content.setLattitude(getLattitude());
        content.setLongtitude(getLongtitude());
        content.setType(getType());
    }

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (!(o instanceof ObjectOnMapShort)) return false;

		ObjectOnMapShort that = (ObjectOnMapShort) o;

		if (type != that.type) return false;
		if (id != that.id) return false;
		if (lattitude != that.lattitude) return false;
		if (longtitude != that.longtitude) return false;

		return true;
	}

	@Override
	public int hashCode() {
		return id;
	}
}
